home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / wirenet15.lzx / UpdateWirenet next >
Text File  |  1978-01-23  |  9KB  |  296 lines

  1. ; $VER: UpdateWirenet 1.5 (21.10.96)
  2. ;
  3. ; This installer and the accompanying scripts are
  4. ; (c) Neil Bothwick, Wirenet Amiga Internet and may
  5. ; not be used in any other package without permission
  6.  
  7.  
  8. ;========================== Define Procedures ==========================
  9.  
  10. (set ArcName 'UpdateWirenet.lzx')
  11. ;;; Abort with message
  12. (procedure GetOut GetOutMsg
  13.         (message GetOutMsg)
  14.         (exit (quiet))
  15. )
  16. ;;;
  17. ;;; Check archive was unarced correctly
  18. (procedure CheckUnarc
  19.     (if (= 0 (exists 'Updates/Dashboard'))
  20.         (GetOut
  21.             (cat
  22.                 '\n' ArcName 'has not been unarchived correctly!\n\n'
  23.                 'Type\n\n"unlzx x ' ArcName ' RAM:"\n\nin a shell and then '
  24.                 'double click on the installer icon in RAM:'
  25.             )
  26.         )
  27.     )
  28. )
  29. ;;;
  30. ;;; Make environment variable
  31. (procedure SetEnv EnvName EnvVal                                ; Creates environment variables in ENV: and ENVARC:
  32.     (set ArcName (tackon 'ENVARC:' EnvName))
  33.     (if (exists ArcName)                                        ; Back it up if it already exists,
  34.         (if (not (exists (cat ArcName '.old')))                 ; has not been previously backed up
  35.             (if (not(= EnvVal (getenv EnvName)))                ; and is not the same value
  36.                 (rename ArcName (cat ArcName '.old'))
  37.             )
  38.         )
  39.     )
  40.     (textfile
  41.         (dest (tackon 'ENVARC:' EnvName))
  42.         (append EnvVal)
  43.     )
  44.     (textfile
  45.         (dest (tackon 'ENV:' EnvName))
  46.         (append EnvVal)
  47.     )
  48. )
  49. ;;;
  50.  
  51. (CheckUnarc)                ; ensure archive was unpacked with paths preserved
  52. (welcome)
  53.  
  54. ;=========================== Install Scripts ===========================
  55. ;;; Introduction
  56. (message
  57.     (cat
  58.         '\nHello ' (getenv 'REALNAME') '\n\n'
  59.         'This will update your Wirenet software to the latest current setup.\n\n'
  60.         'This uses a different method of storing your configuration information '
  61.         'that will make it much easier to make any changes to your system later.\n\n'
  62.         'This will also make future upgrades much simpler.'
  63.     )
  64. )
  65.  
  66. (message
  67.     (cat
  68.         '\nThe installer will attempt to read your existing configuration information.\n\n'
  69.         'Please check these details carefully before proceeding with the installation. If you '
  70.         'have any doubts about this, then abort the installation and contact\n\n'
  71.         'support@wirenet.u-net.com\n\nbefore continuing.'
  72.     )
  73. )
  74. ;;;
  75. ;;; Read existing configuration
  76. (working '\n\nReading your current configuration')
  77. (if (<> 0 (run 'rx ReadConfig.rexx' (safe)))
  78.     (run 'sys:rexxc/rx ReadConfig.rexx' (safe))
  79. )
  80. ; Put values in variables
  81. (set
  82.     DevName
  83.         (if (exists 'ENV:WirenetUpdateDevice' (noreq))
  84.             (getenv 'WirenetUpdateDevice')
  85.             ''
  86.         )
  87.     DevUnit
  88.         (if (exists 'ENV:WirenetUpdateUnit' (noreq))
  89.             (getenv 'WirenetUpdateUnit')
  90.             ''
  91.         )
  92.     Speed
  93.         (if (exists 'ENV:WirenetUpdateSpeed' (noreq))
  94.             (getenv 'WirenetUpdateSpeed')
  95.             ''
  96.         )
  97.     PopNum
  98.         (if (exists 'ENV:WirenetUpdatePopNum' (noreq))
  99.             (getenv 'WirenetUpdatePopNum')
  100.             ''
  101.         )
  102.     Password
  103.         (if (exists 'ENV:WirenetUpdatePassword' (noreq))
  104.             (getenv 'WirenetUpdatePassword')
  105.             ''
  106.         )
  107. )
  108. ; Remove temporary environment variables
  109. (run 'delete >NIL: ENV:WirenetUpdate#?' (safe))
  110. ;;;
  111. ;;;Confirm configuration details
  112. (procedure ConfirmConfig
  113.     (set
  114.         DevName
  115.             (askstring
  116.                 (prompt '\nPlease enter the name of your serial device')
  117.                 (default DevName)
  118.                 (help 'This should be as you gave when installing the Wirenet package')
  119.             )
  120.         DevUnit
  121.             (askstring
  122.                 (prompt '\nPlease select the unit number of ' DevName)
  123.                 (default DevUnit)
  124.                 (help '\nThis is usually 0')
  125.             )
  126.         Speed
  127.             (askstring
  128.                 (prompt '\nPlease enter the speed of your serial connection')
  129.                 (default Speed)
  130.                 (help 'This should be as you gave when installing the Wirenet package')
  131.             )
  132.         ModemInit
  133.             (askstring
  134.                 (prompt '\nPlease enter the initialisation string for your modem')
  135.                 (help 'This should be as you gave when installing the Wirenet package')
  136.                 (default 'ATZ')
  137.             )
  138.         ModemDial
  139.             (askstring
  140.                 (prompt '\nPlease enter the dial string for your modem')
  141.                 (help 'This should be as you gave when installing the Wirenet package')
  142.                 (default 'ATDT')
  143.             )
  144.         PopNum
  145.             (askstring
  146.                 (prompt '\nPlease enter your local access telephone number')
  147.                 (help 'This should be as you gave when installing the Wirenet package')
  148.                 (default PopNum)
  149.             )
  150.         Password
  151.             (askstring
  152.                 (prompt '\nPlease enter your Password')
  153.                 (help 'This should be as you gave when installing the Wirenet package - unless you have changed it since then')
  154.                 (default Password)
  155.             )
  156.     )
  157.     ; Verify information
  158.     (askbool
  159.         (prompt
  160.             (cat
  161.                 'You gave the following details about your configuration\n'
  162.                 '\nDevice name: ' DevName
  163.                 '\nUnit number: ' DevUnit
  164.                 '\nSerial link speed: ' Speed
  165.                 '\nInitialisation string: ' ModemInit
  166.                 '\nDial String: ' ModemDial
  167.                 '\nTelephone number: ' PopNum
  168.                 '\nPassword: ' Password
  169.                 '\n\nPlease check these details carefully.'
  170.             )
  171.         )
  172.         (help '\n\nPlease check these carefully.\n\nDo not proceed unless you are sure they are correct.')
  173.         (choices 'Let me change them' 'They are correct')
  174.     )
  175. )
  176.  
  177. (while (ConfirmConfig))
  178. ;;;
  179. ;;; Create environment variables
  180. (makedir 'ENV:Wirenet')
  181. (makedir 'ENVARC:Wirenet')
  182. (SetEnv 'MAILSERVER' 'mail.u-net.com')
  183. (SetEnv 'NEWSSERVER' 'news.u-net.com')
  184. (SetEnv 'SMTPSERVER' 'send.mail.u-net.com')
  185.  
  186. (if (not (exists 'ENV:MAILBOX'))
  187.     (SetEnv 'MAILBOX' (cat (getenv 'USERNAME') '-' (getenv 'NODENAME')))
  188. )
  189. (setenv 'Wirenet/ModemDev' (cat DevName ' ' DevUnit))
  190. (setenv 'Wirenet/ModemSpeed' Speed)
  191. (setenv 'Wirenet/ModemInit' ModemInit)
  192. (setenv 'Wirenet/ModemDial' ModemDial)
  193. (setenv 'Wirenet/PopNum' PopNum)
  194. (setenv 'Wirenet/ppp.options' 'CD 7WIRE EOFMODE')
  195. (setenv 'Wirenet/Gateway' '193.119.176.1')
  196. (setenv 'Wirenet/DialWindow' 'CON:20/50/400/160/Dialing.../INACTIVE')
  197. (setenv 'Wirenet/MTU' '1500')
  198. (setenv 'Wirenet/pap.config' (cat (getenv 'NODENAME') ' ' Password))
  199. (if (exists 'S:PPP.key')
  200.     (if
  201.         (askbool
  202.             (prompt '\nYou are using the registered version of ppp.device\n\nWould you like to use PAP logins?\n\n')
  203.             (help '\nPAP (Password Authentication Protocol) provides for faster logins')
  204.             (default 0)
  205.         )
  206.         (SetEnv 'Wirenet/UsePAP' 'true')
  207.         (run 'delete >NIL: ENVARC:Wirenet/UsePAP')
  208.     )
  209. )
  210. ;;;
  211. ;;; Copy Dashboard
  212. (copylib
  213.     (prompt 'Updating Dashboard')
  214.     (help @copylib-help)
  215.     (source 'Updates/Dashboard')
  216.     (dest 'AmiTCP:')
  217.     (confirm)
  218. )
  219. (copyfiles
  220.     (prompt 'Updating Dashboard')
  221.     (help @copyfiles-help)
  222.     (source 'Updates/Dashboard.gui')
  223.     (dest 'AmiTCP:')
  224. )
  225. ;;;
  226. ;;;Copy Connect
  227. (copylib
  228.     (prompt 'Updating Connect')
  229.     (help @copylib-help)
  230.     (source 'Updates/Connect')
  231.     (dest 'AmiTCP:bin')
  232.     (confirm)
  233. )
  234. ;;;
  235. ;;; Copy Fetch
  236. (copylib
  237.     (prompt 'Updating Fetch')
  238.     (help @copylib-help)
  239.     (source 'Updates/Fetch')
  240.     (dest 'AmiTCP:bin')
  241.     (confirm)
  242. )
  243. ;;;
  244. ;;; Copy SendEvents
  245. (copylib
  246.     (prompt 'Updating SendEvents')
  247.     (help @copylib-help)
  248.     (source 'Updates/SendEvents')
  249.     (dest 'AmiTCP:bin')
  250.     (confirm)
  251. )
  252. ;;;
  253. ;;; Copy StartNet & StopNet
  254. (copylib
  255.     (prompt 'Updating StartNet')
  256.     (help @copylib-help)
  257.     (source 'Updates/StartNet')
  258.     (dest 'AmiTCP:bin')
  259.     (confirm)
  260. )
  261.  
  262. (copylib
  263.     (prompt 'Updating Stopnet')
  264.     (help @copylib-help)
  265.     (source 'Updates/Stopnet')
  266.     (dest 'AmiTCP:bin')
  267.     (confirm)
  268. )
  269. ;;;
  270. ;;; Copy Documentation
  271. (foreach 'Updates' '#?.guide'
  272.     (copylib
  273.         (prompt 'Updating Documentation')
  274.         (help @copylib-help)
  275.         (source (tackon 'Updates' @each-name))
  276.         (dest 'AmiTCP:doc')
  277.         (confirm)
  278.     )
  279. )
  280. ;;;
  281. ;Copy User files to AmiTCP:db
  282. (foreach 'Updates' 'User-#?'
  283.     (if (= 0 (exists (tackon 'AmiTCP:db' @each-name)))
  284.         (copyfiles
  285.             (prompt (cat 'Copying ' @each-name))
  286.             (help @copyfiles-help)
  287.             (source (tackon 'Updates' @each-name))
  288.             (dest 'AmiTCP:db')
  289.         )
  290.     )
  291. )
  292.  
  293. (message '\n\nThe updated Wirenet software has now been installed.')
  294. (exit (quiet))
  295.  
  296.